package com.letoken.platform.repo.app.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.letoken.platform.repo.app.po.AppUserIssueRecord;
import com.letoken.platform.repo.app.res.config.QueryLetokenHistoryRes;
import com.letoken.platform.repo.mall.po.AppMallIssueRecord;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * Le账户-用户铸币发行记录 Mapper 接口
 * </p>
 *
 * @author 作者
 * @since 2022-12-09
 */
public interface AppUserIssueRecordMapper extends BaseMapper<AppUserIssueRecord> {

    @Select("select sum(issue_amount)  from app_user_issue_record where user_id = #{userId} ")
    BigDecimal selectIssueAmountByUserId(@Param("userId") Integer userId);

    List<Integer> getUserId();

    List<AppUserIssueRecord> getRecord(@Param("userId")Integer userId);

    @Select("select * from app_user_issue_record where wait_circulation>0")
    List<AppUserIssueRecord> getWaitCirculation(@Param("userId")Integer userId);


    BigDecimal  sumIssueAmountByUserIdsAndDate(@Param("userIds") List<Integer> userIds, @Param("startDatetime") LocalDateTime date, @Param("endDatetime") LocalDateTime endDatetime);

    BigDecimal  sumIssueAmountByUserIds( @Param("userIds") List<Integer> userIds);



}
